home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 1995 #2 / Amiga Plus CD - 1995 - No. 2.iso / pd / datatype / bmp / classbase.h < prev    next >
C/C++ Source or Header  |  1995-04-11  |  5KB  |  131 lines

  1. /******************************************************************************
  2.  *
  3.  * COPYRIGHT: Unless otherwise noted, all files are Copyright (c) 1992, 1993
  4.  * Commodore-Amiga, Inc.  All rights reserved.
  5.  *
  6.  * DISCLAIMER: This software is provided "as is".  No representations or
  7.  * warranties are made with respect to the accuracy, reliability, performance,
  8.  * currentness, or operation of this software, and all use is at your own risk.
  9.  * Neither commodore nor the authors assume any responsibility or liability
  10.  * whatsoever with respect to your use of this software.
  11.  *
  12.  ******************************************************************************
  13.  * classbase.h
  14.  * Header file for DataTypes class
  15.  *
  16.  */
  17.  
  18. #include <dos/dos.h>
  19. #include <dos/dosextens.h>
  20. #include <exec/types.h>
  21. #include <exec/ports.h>
  22. #include <exec/memory.h>
  23. #include <exec/lists.h>
  24. #include <exec/semaphores.h>
  25. #include <exec/execbase.h>
  26. #include <intuition/classes.h>
  27. #include <intuition/classusr.h>
  28. #include <intuition/cghooks.h>
  29. #include <intuition/gadgetclass.h>
  30. #include <graphics/gfx.h>
  31. #include <graphics/text.h>
  32. #include <libraries/iffparse.h>
  33. #include <datatypes/datatypes.h>
  34. #include <datatypes/datatypesclass.h>
  35. #include <datatypes/pictureclass.h>
  36. #include <string.h>
  37. #include <dos.h>
  38.  
  39. #include <clib/macros.h>
  40. #include <clib/dos_protos.h>
  41. #include <clib/exec_protos.h>
  42. #include <clib/intuition_protos.h>
  43. #include <clib/iffparse_protos.h>
  44. #include <clib/graphics_protos.h>
  45. #include <clib/utility_protos.h>
  46. #include <clib/datatypes_protos.h>
  47. #include <clib/dtclass_protos.h>
  48.  
  49. #include <pragmas/dos_pragmas.h>
  50. #include <pragmas/exec_pragmas.h>
  51. #include <pragmas/intuition_pragmas.h>
  52. #include <pragmas/iffparse_pragmas.h>
  53. #include <pragmas/graphics_pragmas.h>
  54. #include <pragmas/utility_pragmas.h>
  55. #include <pragmas/datatypes_pragmas.h>
  56. #include <pragmas/dtclass_pragmas.h>
  57.  
  58. /*****************************************************************************/
  59.  
  60. #define BMPDTCLASS              "bmp.datatype"
  61.  
  62. /*****************************************************************************/
  63.  
  64. struct ClassBase
  65. {
  66.     struct Library         cb_Lib;
  67.     UWORD             cb_UsageCnt;
  68.     struct Library        *cb_SysBase;
  69.     struct Library        *cb_DOSBase;
  70.     struct Library        *cb_IntuitionBase;
  71.     struct Library        *cb_GfxBase;
  72.     struct Library        *cb_UtilityBase;
  73.     struct Library        *cb_IFFParseBase;
  74.     struct Library        *cb_DataTypesBase;
  75.     struct Library        *cb_SuperClassBase;
  76.     BPTR             cb_SegList;
  77.  
  78.     struct SignalSemaphore     cb_Lock;        /* Access lock */
  79.     Class            *cb_Class;
  80. };
  81.  
  82. /*****************************************************************************/
  83.  
  84. #define    MAXCOLORS        256
  85. #define    SQ(x)            ((x)*(x))
  86. #define    AVGC(i1,i2,c)        ((ir->ir_GRegs[i1][c]>>1)+(ir->ir_GRegs[i2][c]>>1))
  87. #define VANILLA_COPY        0xC0
  88. #define NO_MASK            0xFF
  89. #define    MAXSRCPLANES        24
  90. #define    BPR(w)            ((w) + 15 >> 4 << 1)
  91. #define MaxPackedSize(rowSize)  ((rowSize) + (((rowSize)+127) >> 7 ))
  92. #define    RowBytes(w)        ((((w) + 15) >> 4) << 1)
  93. #define    ChunkMoreBytes(cn)    (cn->cn_Size - cn->cn_Scan)
  94. #define UGetByte()        (*source++)
  95. #define UPutByte(c)        (*dest++ = (c))
  96.  
  97. /*****************************************************************************/
  98.  
  99. #define MEMORY_FOLLOWING(ptr)    ((void *)((ptr)+1))
  100. #define MEMORY_N_FOLLOWING(ptr,n)  ((void *)( ((ULONG)ptr) + n ))
  101. #define ASM            __asm
  102. #define REG(x)            register __ ## x
  103.  
  104. /*****************************************************************************/
  105.  
  106. #define SysBase            cb->cb_SysBase
  107. #define DOSBase            cb->cb_DOSBase
  108. #define UtilityBase        cb->cb_UtilityBase
  109. #define    IntuitionBase        cb->cb_IntuitionBase
  110. #define    IFFParseBase        cb->cb_IFFParseBase
  111. #define    GfxBase            cb->cb_GfxBase
  112. #define    DataTypesBase        cb->cb_DataTypesBase
  113.  
  114. /*****************************************************************************/
  115.  
  116. ULONG __stdargs DoMethodA (Object *obj, Msg message);
  117. ULONG __stdargs DoMethod (Object *obj, unsigned long MethodID, ...);
  118. ULONG __stdargs DoSuperMethodA (struct IClass *cl, Object *obj, Msg message);
  119. ULONG __stdargs DoSuperMethod (struct IClass *cl, Object *obj, unsigned long MethodID, ...);
  120. ULONG __stdargs CoerceMethodA (struct IClass *cl, Object *obj, Msg message);
  121. ULONG __stdargs CoerceMethod (struct IClass *cl, Object *obj, unsigned long MethodID, ...);
  122. ULONG __stdargs SetSuperAttrs (struct IClass *cl, Object *obj, unsigned long Tag1, ...);
  123.  
  124. void kprintf (void *, ...);
  125.  
  126. VOID ASM ExpandByteRun (REG (a0) BYTE *srcData, REG (a1) BYTE *dstData, REG (d0) WORD srcBytes);
  127.  
  128. /*****************************************************************************/
  129.  
  130. #include "class_iprotos.h"
  131.